﻿
using System;
using System.Linq;

    class IsTheBitValueOne
    {
        static void Main(string[] args)
        {
            int v = 5;
            Console.WriteLine(Convert.ToString(v, 2));
            int p = 2;
            int mask = 1<<p;
            int vAndMask = v & mask;
            Console.WriteLine(Convert.ToString(vAndMask, 2));
            bool isOne = (vAndMask != 0);
            if (isOne)
            {
            }
            else
            { 
            }
            Console.Write("The value of the bit on the position {0} is 1: ", p);
            Console.WriteLine(isOne);


        }
    }

